package com.sz.dao.frame;

import com.sz.pojo.frame.User;
import org.hibernate.Query;
import org.springframework.stereotype.Repository;

import java.util.List;
import java.util.Map;

/**
 *
 */
@Repository
public class UserDao extends BaseDao<User>{
	@SuppressWarnings("unchecked")
	public List<User> find4Paramsw(String hql, Map<String, Long[]> params) {
		Query query = getSession().createQuery(hql);
		query.setCacheable(true);
		if (params != null && params.size() > 0) {
			for (String key : params.keySet()) {
				query.setParameterList(key, params.get(key));
			}
		}
		return query.list();
	}
}
